﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using IntraVision.Web;
using IntraVision.Web.Security;
using Model;

[AllowedRole("DictionaryAdmin")]
public class NotarialSettingsController :EntityListController<NotarialSetting,NotarialServiceDataContext>
{
    public void Default()
    {
        NotarialSetting ns = null;
        using (var dc = new NotarialServiceDataContext())
        {
            ns = dc.NotarialSettings.FirstOrDefault();
        }
        if (ns != null)        
            View(ns.Id.ToString());        
        else
            Create();
    }

    protected override void EntityLoaded(NotarialServiceDataContext dc, NotarialSetting entity)
    {
        RegisterScript("jquery.ajax-form.js","ckeditor/ckeditor.js", "ckeditor/adapters/jquery.js");
    }

    public override void List()
    {
        return;
    }

    public override void View(string entityid)
    {
        base.View(entityid);
    }

}
